home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2002 #12 / Amiga Plus CD - 2002 - No. 12.iso / Tools / Freeware / Swf_Player / Lib / amiga_specific.h < prev    next >
Encoding:
C/C++ Source or Header  |  2002-11-17  |  1.1 KB  |  57 lines

  1. /*
  2. **
  3. ** $VER: amiga_specific.h 0.2 (03.10.02)
  4. ** Description
  5. **
  6. ** (C) Copyright 2002 Alexandre Balaban
  7. **
  8. ** $HISTORY :
  9. **        - 0.2, 03.10.02 : Included PPC compilation improvements by Steffen Haeuser
  10. **        - 0.1, 27.07.02 : Original version
  11. **
  12. */
  13.  
  14. #ifndef _AMIGA_SPECIFIC_H_
  15. #define _AMIGA_SPECIFIC_H_
  16.  
  17. #ifdef AMIGA
  18. #ifdef __cplusplus
  19. extern "C" {
  20. #endif
  21. #include <dos/dos.h>
  22. #include <devices/timer.h>
  23. #include <dos/datetime.h>
  24. #ifndef __PPC__
  25. extern struct DateStamp * DateStamp( struct DateStamp *);
  26. #endif // !__PPC__
  27. #ifdef __cplusplus
  28. }
  29. #endif
  30.  
  31. #ifndef __PPC__
  32. struct myTimeval {
  33.     long    tv_sec;        /* seconds */
  34.     long    tv_usec;    /* and microseconds */
  35. };
  36.  
  37. static int gettimeofday( struct myTimeval * tval, struct timezone * tz )
  38. {
  39.     struct DateStamp stDs,*stDs2;
  40.     
  41.     stDs2 = DateStamp( &stDs );
  42.     tval->tv_usec = stDs.ds_Tick % TICKS_PER_SECOND;
  43.     tval->tv_sec = stDs.ds_Minute * 60 + stDs.ds_Tick / TICKS_PER_SECOND;
  44.     
  45.     return 0;
  46. }
  47. #else
  48. struct timeval;
  49. #define myTimeval timeval
  50. #endif // !__PPC__
  51. #else
  52. struct timeval;
  53. #define myTimeval timeval
  54. #endif // AMIGA
  55.  
  56. #endif /* AMIGA_SPECIFIC */
  57.